package qunchat;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.net.Socket;

public class ChatThread extends Thread{
	private Socket s;
	public ChatThread(Socket s) {
		this.s=s;
	}
	public void run(){
		ObjectInputStream in = null;
		try {
			in = new ObjectInputStream(s.getInputStream());			
			String ob=(String) in.readObject();
			while(!ob.equals("bye")){
				System.out.println("==>"+ob);				
				in=new ObjectInputStream(s.getInputStream());
			    ob=(String) in.readObject();
	     	}
			      in.close();
			}catch (IOException | ClassNotFoundException e) {
			e.printStackTrace();
		}
	}
}